package com.geek.water.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/7/27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("设备分页查询参数")
public class DevicePageQueryVO {
    @ApiModelProperty(value = "当前页码", example = "1")
    private Integer currentPage = 1;

    @ApiModelProperty(value = "每页数量", example = "10")
    private Integer pageSize = 10;

    // 综合搜索（型号/序列号模糊匹配）
    @ApiModelProperty(value = "综合搜索词（型号/序列号）", example = "WT-2000")
    private String queryString;

    // 精确过滤条件
    @ApiModelProperty(value = "在线状态", allowableValues = "online,offline")
    private String status;

    @ApiModelProperty(value = "区域ID", example = "2")
    private Long areaId;

    @ApiModelProperty(value = "客户ID", example = "1")
    private Long customerId;

    @ApiModelProperty(value = "计费周期", example = "2024-01")
    private String billingPeriod;

    @ApiModelProperty(value = "最后心跳时间-开始", example = "2024-06-01 00:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastHeartbeatStart;

    @ApiModelProperty(value = "最后心跳时间-结束", example = "2024-06-30 23:59:59")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastHeartbeatEnd;

    // 排序字段
    @ApiModelProperty(value = "排序字段", allowableValues = "lastHeartbeat,createdAt", example = "lastHeartbeat")
    private String sortField;

    @ApiModelProperty(value = "排序方式", allowableValues = "asc,desc", example = "desc")
    private String sortOrder;
}
